package com.hertz.appr.http;

import java.util.ArrayList;
import java.util.List;

import com.hertz.appr.oauth.OAuth;

public class MyHttpElement {
	
	private String httpMethod;
	private String queryString;
	private List<Parameter> params;
	private List<Parameter> queryParams = new ArrayList<Parameter>();
	
	
//	public void addQueryString(String name ,String value){
//		if(queryString == null || queryString.equals("")){
//			queryString = name + "=" + value;
//		}else{
//			queryString = queryString + "&" + name + "=" + value;
//		}
//	}
	
	public void addRequestParam(String name,String value){
		queryParams.add(new PostParameter(name, value));
	}
	
	public void addRequestParam(PostParameter pp){
		queryParams.add(pp);
	}
	
	public void addQueryParam(List<Parameter> list){
		queryParams.addAll(list);
//		if(qs != null && !qs.equals("")){
//			if(queryString == null || queryString.equals("")){
//				queryString = qs;
//			}else{
//				queryString = queryString + "&" + qs;
//			}
//		}
	}
	
	public String getHttpMethod() {
		return httpMethod;
	}
	public void setHttpMethod(String httpMethod) {
		this.httpMethod = httpMethod;
	}
	public String getQueryString() {
		return OAuth.encodeParameters(queryParams);
	}
	
	public List<Parameter> getParams(){
		return queryParams;
	}
	
	public List<Parameter> getHeaderParams() {
		return params;
	}
	public void setHeaderParams(List<Parameter> params) {
		this.params = params;
	}
	
	
}
